import request from '@/utils/request'

// 营业额统计
export const getTurnoverStatisticsService = (dateRange) => {
  return request.get('/admin/statistics/turnover', { params: dateRange })
}

// 会员数量统计
export const getMemberStatisticsService = (dateRange) => {
  return request.get('/admin/statistics/member', { params: dateRange })
}

// 业务统计
export const getBusinessStatisticsService = (dateRange) => {
  return request.get('/admin/statistics/business', { params: dateRange })
}

// 服务项目排名统计
export const getProjectTop10Service = (dateRange) => {
  return request.get('/admin/statistics/top10/project', { params: dateRange })
}

// 会员消费排名统计
export const getEmployeeTop10Service = (dateRange) => {
  return request.get('/admin/statistics/top10/employee', { params: dateRange })
}

// 会员消费排名统计
export const getMemberTop10Service = (dateRange) => {
  return request.get('/admin/statistics/top10/member', { params: dateRange })
}

// 导出近30天的业务统计报表
export const exportBusinessStatisticsReportService = () => {
  return request.get('/admin/statistics/export/business', {
    responseType: 'blob' // 二进制数据
  })
}

// 导出指定服务项目报表
export const exportProjectStatisticsReportService = (id) => {
  return request.get(`/admin/statistics/export/project/${id}`, {
    responseType: 'blob' // 二进制数据
  })
}
